package com.icangya.DAO.impl;

import com.icangya.DAO.IFbWxSuitcaseDAO;
import com.icangya.domain.FbPayInfo;
import com.icangya.domain.FbWxSuitcaseDO;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.List;

@Repository
public class FbWxSuitcaseDAOImpl extends BaseDAO<FbWxSuitcaseDO> implements IFbWxSuitcaseDAO{


    @Override
    public Integer selectFbWxSuitcaseServiceByUseridAndCreateTime(long userid) {
//        TO_DAYS(rr.rechargeTime)=TO_DAYS(?)
        String hql=" select sum(rr.amount) from FbWxSuitcaseDO rr where rr.userid ";

        Integer amounts = (Integer)getHibernateTemplate().find(hql,userid).get(0);
        if(amounts==null)
            amounts=0;
        return amounts;
    }
}
